<template>
  <div>
    <h3>{{msg}}</h3>
    <p>{{count}}</p>
    <button @click="dec">按钮dec</button>
    <button @click="inc">按钮inc</button>
    <button @click="set(12)">按钮set</button>
    <button @click="reset">按钮reset</button>

    
  </div>
</template>

<script lang="ts">
import { onMounted, ref } from 'vue'
import useCount from './hooks/userCount'
import useUserControl from './hooks/useUserControl'
export default {
  name: 'CountDemo',
  props: {
    msg: String
  },
  setup() {
    const { current: count, inc, dec, set, reset } = useCount(2, {
      min: 1,
      max: 15
    })
    const msg = ref('Demo useCount')
 

    const { userInfo, initData, onChangePassword, onChangeUserInfo } = useUserControl();
    onMounted(()=>{
      initData()
    })
    return {
      count,
      inc,
      dec,
      set,
      reset,
      msg
    }
  }
}
</script>

<style>

</style>
